CC:=g++ -g

# automatically update tags when compiling
all: greedy tags

greedy: greedy.o cover.o set_cover.o vertex_cover.o improved_vertex_cover.o improved_set_cover.o
	${CC} -o $@ $^

greedy.o: greedy.cpp set_cover.h vertex_cover.h improved_vertex_cover.h improved_set_cover.h
	${CC} -c $<

cover.o: cover.cpp 
	${CC} -c $<

set_cover.o: set_cover.cpp cover.h
	${CC} -c $<

vertex_cover.o: vertex_cover.cpp cover.h
	${CC} -c $<

improved_vertex_cover.o: improved_vertex_cover.cpp cover.h
	${CC} -c $<

improved_set_cover.o: improved_set_cover.cpp cover.h
	${CC} -c $<

tags:
	ctags -R

clean:
	\rm greedy.o cover.o set_cover.o vertex_cover.o improved_vertex_cover.o

.PHONY: clean
